package com.cloudbroker.bcs.platform.dav.middle.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.ExtendAppGroupDavListData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.ExtendAppGroupFansListData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.plugs.result.ExtendAppGroupWithExtendAppListData;
import com.cloudbroker.bcs.platform.dav.middle.dao.ExtendAppGroupDAO;
import com.cloudbroker.bcs.platform.dav.middle.entity.ExtendAppGroup;
import com.cloudbroker.bcs.platform.dav.middle.service.ExtendAppGroupService;
import com.cloudbroker.bcs.platform.dav.middle.service.base.TenantServiceImplBase;

@Service
public class ExtendAppGroupServiceImpl extends TenantServiceImplBase<ExtendAppGroup, String> implements ExtendAppGroupService{

	@Resource
	private ExtendAppGroupDAO extendAppGroupDAO;
	
	@Override
	protected ExtendAppGroupDAO getDAO(){
		return extendAppGroupDAO;
	}

	@Override
	public List<ExtendAppGroupDavListData> queryWithPlugsForDav(
			ExtendAppGroup form) {
		return extendAppGroupDAO.queryWithPlugsForDav(form);
	}

	@Override
	public List<ExtendAppGroupFansListData> queryWithPlugsForFans(
			ExtendAppGroup form) {
		return extendAppGroupDAO.queryWithPlugsForFans(form);
	}

	@Override
	public void delByCondition(String broker_id,String extend_group_id,String extend_app_id,Integer tenant_id) {
		extendAppGroupDAO.delByCondition(broker_id,extend_group_id,extend_app_id,tenant_id);
	}

	@Override
	public Long getMaxSort(ExtendAppGroup form) {
		Long maxNum = extendAppGroupDAO.getMaxSort(form);
		return maxNum == null ? 0 : maxNum+1L;
	}

    @Override
    public List<ExtendAppGroupWithExtendAppListData> listWithExtendApp(ExtendAppGroup form) {
        return extendAppGroupDAO.listWithExtendApp(form);
    }

    @Override
    public void deleteAll() {
        extendAppGroupDAO.deleteAll();
    }
}
